<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0" />
        <meta name="format-detection" content="telephone=no" />
        <meta content="yes" name="mobile-web-app-capable">
        <meta content="yes" name="apple-mobile-web-app-capable" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <title>{php echo empty($theme['jubf'])?'':$theme['jubf'].'-';}{php echo !empty($theme['USERCOMPANYNAME'])?$theme['USERCOMPANYNAME']:$_G['companyname'];}</title>
        <script type="text/javascript">
            var deviceWidth = document.documentElement.clientWidth;
            if(deviceWidth > 414)
                 deviceWidth = 540; 
            document.documentElement.style.fontSize = deviceWidth / 7.5 + 'px';
        </script>
        <link rel="stylesheet" type="text/css" href="{$_G['URL']['WORKER_CSS']}css/reset.css">
        <link rel="stylesheet" type="text/css" href="{$_G['URL']['WORKER_CSS']}css/index.css">
        <link rel="stylesheet" type="text/css" href="{$_G['URL']['WORKER_CSS']}css/ui.css">
        <script type="text/javascript" src="{$_G['URL']['WORKER_CSS']}js/rem.js"></script>
        <script type="text/javascript" src="{$_G['URL']['WORKER_CSS']}js/jquery.js"></script>
        <style type="text/css">
            input{
                width: 96%;
                height: 0.55rem;
                font-size: 0.3rem;
                border: 1px solid #19b5ee;
                border-radius: 5px;
                margin-top: 0.05rem;
                padding: 0.05rem 0.1rem;
            }
            select{
                width: 100%;
                height: 0.68rem;
                font-size: 0.3rem;
                border: 1px solid #19b5ee;
                border-radius: 5px;
                margin-top: 0.05rem;
                padding: 0.05rem 0.1rem;
            }

            #headimg{
                width: 12rem;
                height: 12rem;
                border: 2px solid #ffffff;
                border-radius:100% ;
                margin: auto;
                margin-bottom: 1.7rem;
                background-size:100% 100% !important;
                background-repeat:no-repeat;
                background-position: center center;
            }
            .btn{
                position: relative;
                z-index: 10;
                padding: 0.5rem;
                height: 1.6rem;
                line-height: 1.6rem;
                margin: auto;
                font-size: 0.8rem;
                color: #fd1142!important;
                border:1px solid  #fd1142;
                border-radius:0.2rem ;
            }
            .btn img{
                display: inline-block;
                width: 0.75rem;
                margin-left: 0.1rem;
            }
            
            
            /*截图上传页面*/
            .clipbg{
                position: fixed;
                background: black;
                top: 0;
                z-index: 999;
                width: 100%;
                height: 100%;
                left: 0;
            }
            .loading{
                position: absolute;
                top: 40%;
                width: 38%;
                left: 31%;
                height: 1.6rem;
                line-height: 1.6rem;
                z-index: 99999;
                text-align: center;
                color: #ffffff;
                border-radius:0.2rem ;
                background: #9f9f9f;
            }
            .clipbg #clipArea2{
                width: 100%;
                height: 80%;
                margin: auto;

            }
            .clipbg .footer{
                width: 90%;
                position: fixed;
                left: 5%;
                bottom: .2rem;
                border-radius:.4rem; overflow:hidden;
                text-align: center;
            }
            .clipbg dl{
                overflow: hidden;

                float:left; width:66.66%;
            }
            .clipbg dd{
                position: relative;
                height: 0.9rem;
                line-height: 0.9rem;
                width:50%; 
                float:left;
            }
            .clipbg .back{
                height: 0.9rem;
                line-height:0.9rem;
                background: #ffffff;
                float:left; width:33.33%;
            }
            .clipbg dd input{
                position: absolute;
                width: 100%;
                height: 100%;
                top: 0;
                left: 0;
                z-index: 11;
                filter:alpha(opacity=0);  
              -moz-opacity:0;  
              -khtml-opacity: 0;  
              opacity: 0; 
            }

            .uploadNotice { position:fixed; width:100%; text-align:center; color:#FFF; font-size:12px; bottom: 1.2rem;}
        </style>
        </style>
    </head>
     
    <body>
        <header class="order_header" style="font-size: 0.5rem;">
            <!-- <div class="go_back">
                <img src="{$_G['URL']['WORKER_CSS']}images/order_03.png">
                返回首页
            </div> -->
            {php echo !empty($theme['USERCOMPANYNAME'])?$theme['USERCOMPANYNAME']:$_G['companyname'];}・微信营销专家
        </header>


        <div class="s_items s_bg">
            <div class="s_title">
                <img src="{$_G['URL']['WORKER_CSS']}images/title_17.png">
                员工信息设置
            </div>
        </div>
    {if $op == 'last' }
        <form action='{php echo "/".createMobileUrl($do,array("op"=>"save","themeid"=>$themeid,"server_openid"=>$_P['server_openid']));}' method="post" onsubmit="return check2()">  
            <div class="lmsz_cont">
                {if $system['ruanjian']==3}
                <div class="item">
                    <p><span style="color: #ff0000">*</span>所属企业</p>
                    <input type="text" id="adminpass" name="adminpass" placeholder="请注意管理员与员工密码不相同"  value="{$shopname}"/>
                </div>
                {/if}
                {if !empty($teamlist)}
                <div class="item">
                    <p><span style="color: #ff0000">*</span>请选择所属团队</p>
                    <select id="team" name="team" class="sdiv">
                        <option value="">请选择所属团队</option>
                        {loop $teamlist $row}
                        <option value="{$row['id']}" {if $row['id'] == $myworker['team']}selected="selected"{/if}>{$row['name']}</option>
                        {/loop}
                    </select>
                </div>
                {/if}
                <div class="item">
                    <p>昵称：</p>
                    <input type="text" id="username" name="username" placeholder="客户一般怎么称呼你? 如:安然" value="{$myworker['username']}" />
                </div>
                <div class="item">
                    <p>电话：</p>
                    <input type="number" id="mobile" name="mobile" placeholder="客户能联系到你的电话,非主力销售建议留队长电话" value="{$myworker['mobile']}" />
                </div>
                <div class="item" style="height: 2.6rem;">
                    <p>微信二维码：</p>
                    <a class="logo" id="logox" href="javascript:uploadqr()">
                        {if empty($myworker['qrcode'])}
                        <img id="bgl" align="right"  style="width: 40px;height: 40px; " src="{$_G['URL']['YX2020_CSS']}avatar/img/headbig.png">
                        {else}
                        <img id="bgl" src="{$myworker['qrcode']}" align="right" style=" width: 2rem;height:2rem;"><input type="hidden" name="qrcode" value="{$myworker['qrcode']}" />
                        {/if}
                    </a>
                </div>
                <div class="form-group">
                  <div class="col-sm-offset-2 col-sm-10">
                    <p class="help-block">昵称、电话将出现在活动链接中.</p>
                    <p class="help-block">后续如需可重新识别‘添加员工二维码’,修改</p>
                  </div>
                </div>

                <div style="text-align: center;">
                    <input type="hidden" name="level" value="{$level}">
                    <input type="hidden" name="company" value="{$company}">
                    <button class="l_btn" type="submit" >提交保存</button>
                </div>
                <div style="height: 30px"></div>
            </div>
        </form>

        <!--图片裁剪-->
        <div class="clipbg displaynone">
            <div id="clipArea2"></div>
            <div class="loading displaynone">正在载入图片...</div>

            <div class="uploadNotice">上传二维码后，若不显示图片请点击此处</div>
            <div class="footer">
            <dl>
                <dd id="open1" style="background: #087b9c; color: #ffffff;border: none;">上传二维码</dd>
                <dd id="clipBtn2" style="background:#14bbdf; color: #ffffff;border: none;">保存</dd>
            </dl>
            <div class="back" style="background:#62d4f5" color: #ffffff;>取消</div>
            </div>
        </div>
        
        <!-- <link rel="stylesheet" type="text/css" href="{$_G['URL']['YX2020_CSS']}avatar/css/aui.css"/> -->
        <link rel="stylesheet" href="{$_G['URL']['YX2020_CSS']}avatar/css/intial.css" />
    <script type="text/javascript" src="{$_G['URL']['YX2020_CSS']}avatar/js/jquery.min.js"></script>
    <script type="text/javascript" src="{$_G['URL']['YX2020_CSS']}avatar/js/camera.js/hammer.min.js" ></script>
    <script type="text/javascript" src="{$_G['URL']['YX2020_CSS']}avatar/js/camera.js/lrz.all.bundle.js" ></script>
    <script type="text/javascript" src="{$_G['URL']['YX2020_CSS']}avatar/js/camera.js/iscroll-zoom-min.js" ></script>
    <script type="text/javascript" src="{$_G['URL']['YX2020_CSS']}avatar/js/camera.js/PhotoClip.js" ></script>
    <script src='https://res.wx.qq.com/open/js/jweixin-1.3.2.js'></script>
    <script type="text/javascript">

    wx.config({
        debug: false,
        appId: '<?php echo $wx["appId"];?>',
        timestamp: '<?php echo $wx["timestamp"];?>',
        nonceStr: '<?php echo $wx["nonceStr"];?>',
        signature: '<?php echo $wx["signature"];?>',
        jsApiList: [
            // 所有要调用的 API 都要加到这个列表中
            'chooseImage',
            'uploadImage'
        ]
    });
    wx.ready(function () {
        // 在这里调用 API
        wx.checkJsApi({
            jsApiList: ['chooseImage'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
            success: function (res) {
                console.log(res)
                // 以键值对的形式返回，可用的api值true，不可用为false
                // 如：{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
            }
        });
    });

    $(function () {
        $('#open1').on('click', function () {
            // console.log('chooseImage')
            wx.chooseImage({
                count: 1, // 默认9
                sizeType: ['comporess'], // 可以指定是原图还是压缩图，默认二者都有['original','comporess'],
                sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
                success: function (res) {
                    // alert(111 + res.localIds[0])
                    wx.uploadImage({
                        localId: res.localIds[0], // 需要上传的图片的本地ID，由chooseImage接口获得
                        isShowProgressTips: 1, // 默认为1，显示进度提示
                        success: function (res) {
                            var serverId = res.serverId; // 返回图片的服务器端ID
                            var posturl = '{$uploadurl}'+'&bid=' + encodeURI(serverId);
                            // alert('=' +serverId+'=')

                             $.ajax({
                                  type: 'POST',
                                  dataType : "json",
                                  url:posturl,
                                  data: {aid:serverId},
                                  success: function(data) {
                                    // alert(data);
                                   data = data.message;
                                     // if(data.errcode == 0){
                                        // alert(data.remotepath)
                                        clipArea2.load(data.remotepath)
                                     // }
                                  },
                                  error: function() {
                                  }
                              });

                            // $.post(posturl,{serverId:res.serverId} , function (response) {
                                // alert(response)
                                /*getUrlBase64(response,'jpg',function (blob) {
                                    let url = window.URL.createObjectURL(dataURLtoBlob(blob))

                                    clipArea2.load(url)
                                })*/
                                // clipArea2.load(response)
                            // })

                            var serverId = res.serverId; // 返回图片的服务器端ID
                        }
                    });
                    // alert(222)
                    /*wx.getLocalImgData({
                        localId: res.localIds[0], // 图片的localID
                        success: function (res) {

                            //localData = 'data:image/png;base64,' + res.localData; // localData是图片的base64数据，可以用img标签显示
                            //alert(localData.length);
                            //let url = window.URL.createObjectURL(dataURLtoBlob(localData))

                            //clipArea2.load(url)
                        }
                    });*/
                    localId = res.localIds[0]
                }
            });
        })
    })
    // $(function () {
    //     $('#open1').on('click', function () {
    //         wx.chooseImage({
    //             count: 1, // 默认9
    //             sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
    //             sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
    //             success: function (res) {
    //                 wx.getLocalImgData({
    //                     localId: res.localIds[0], // 图片的localID
    //                     success: function (res) {
    //                         localData = 'data:image/png;base64,' + res.localData; // localData是图片的base64数据，可以用img标签显示
    //                         let url = window.URL.createObjectURL(dataURLtoBlob(localData));
    //                         console.log(url);
    //                         clipArea2.load(url);
    //                     }
    //                 });
    //             }
    //         });
    //     })
    // })

    /**
     * base64 convert blob
     * @param dataurl
     * @returns {Blob}
     */
    function dataURLtoBlob(dataurl) {
        var arr = dataurl.split(','),
            mime = arr[0].match(/:(.*?);/)[1],
            bstr = atob(arr[1]),
            n = bstr.length,
            u8arr = new Uint8Array(n);
        while (n--) {
            u8arr[n] = bstr.charCodeAt(n);
        }
        return new Blob([u8arr], {type: mime});
    }

    /**
     *
     * @param url 图片路径
     * @param ext 图片格式
     * @param callback 结果回调
     */
    function getUrlBase64(url, ext, callback) {
        var canvas = document.createElement("canvas");   //创建canvas DOM元素
        var ctx = canvas.getContext("2d");
        var img = new Image;
        img.crossOrigin = 'Anonymous';
        img.src = url;
        img.onload = function () {
            canvas.height = 60; //指定画板的高度,自定义
            canvas.width = 85; //指定画板的宽度，自定义
            ctx.drawImage(img, 0, 0, 60, 85); //参数可自定义
            var dataURL = canvas.toDataURL("image/" + ext);
            callback.call(this, dataURL); //回掉函数获取Base64编码
            canvas = null;
        };
    }
    </script>
    <script>
        function uploadqr() {
            $(".clipbg").fadeIn()
        }
        var clipArea2 = new  PhotoClip("#clipArea2", {
                size: [300, 300],//裁剪框大小
                outputSize:[0,0],//打开图片大小，[0,0]表示原图大小
                file: "#file2",
                ok: "#clipBtn2",
                loadStart: function() { //图片开始加载的回调函数。this 指向当前 PhotoClip 的实例对象，并将正在加载的 file 对象作为参数传入。（如果是使用非 file 的方式加载图片，则该参数为图片的 url）
                    $(".loading").removeClass("displaynone");

                },
                loadComplete: function() {
            //图片加载完成的回调函数。this 指向当前 PhotoClip 的实例对象，并将图片的 <img> 对象作为参数传入。
                    $(".loading").addClass("displaynone");

                },
                done: function(dataURL) { //裁剪完成的回调函数。this 指向当前 PhotoClip 的实例对象，会将裁剪出的图像数据DataURL作为参数传入。 

                    console.log("压缩前", dataURL.length / 1024)
                    dealImage(dataURL, 300, printing);

                    $('#logox').html('<img id="bgl" src="' + base64 + '" align="right" style=" width: 2rem;height:2rem;"><input type="hidden" name="qrcode" value="' + base64 + '" />');
                    // console.log(dataURL);//dataURL裁剪后图片地址base64格式提交给后台处理
                    $(".clipbg").fadeOut()
                }
            });
            $(".back").click(function(){
                $(".clipbg").fadeOut()
            })
                //压缩方法
        function dealImage(base64, w, callback) {
            var newImage = new Image();
            var quality = 0.8;    //压缩系数0-1之间
            newImage.src = base64;
            newImage.setAttribute("crossOrigin", 'Anonymous');  //url为外域时需要
            var imgWidth, imgHeight;
            newImage.onload = function () {
                imgWidth = this.width;
                imgHeight = this.height;
                var canvas = document.createElement("canvas");
                var ctx = canvas.getContext("2d");
                if (Math.max(imgWidth, imgHeight) > w) {
                    if (imgWidth > imgHeight) {
                        canvas.width = w;
                        canvas.height = w * imgHeight / imgWidth;
                    } else {
                        canvas.height = w;
                        canvas.width = w * imgWidth / imgHeight;
                    }
                } else {
                    canvas.width = imgWidth;
                    canvas.height = imgHeight;
                    quality = 0.6;
                }
                ctx.clearRect(0, 0, canvas.width, canvas.height);
                ctx.drawImage(this, 0, 0, canvas.width, canvas.height);
                var base64 = canvas.toDataURL("image/jpeg", quality); //压缩语句
                // 如想确保图片压缩到自己想要的尺寸,如要求在50-150kb之间，请加以下语句，quality初始值根据情况自定
                // while (base64.length / 1024 > 150) {
                //  quality -= 0.01;
                //  base64 = canvas.toDataURL("image/jpeg", quality);
                // }
                // 防止最后一次压缩低于最低尺寸，只要quality递减合理，无需考虑
                // while (base64.length / 1024 < 50) {
                //  quality += 0.001;
                //  base64 = canvas.toDataURL("image/jpeg", quality);
                // }
                callback(base64);//必须通过回调函数返回，否则无法及时拿到该值
            }
        }
 
        //使用压缩
        function printing(base64) {
            console.log("压缩后2", base64.length / 1024)
            $('#logox').html('<img id="bgl" src="' + base64 + '" align="right" style=" width: 2rem;height:2rem;"><input type="hidden" name="qrcode" value="' + base64 + '" />');
            // console.log(dataURL);//dataURL裁剪后图片地址base64格式提交给后台处理
            $(".clipbg").fadeOut()
        }
    </script>
    {elseif $op == 'next' }
        {if $level == 'admin' || $level == 'shop'}
        <form action='{php echo "/".createMobileUrl($do,array("op"=>"last","themeid"=>$themeid,"server_openid"=>$_P['server_openid']));}' method="post">  
            <div class="lmsz_cont">
                {if $system['ruanjian']==3}
                <div class="item">
                    <p><span style="color: #ff0000">*</span>所属企业</p>
                    <input type="text" id="adminpass" name="adminpass" placeholder="请注意管理员与员工密码不相同"  value="{$shopname}"/>
                </div>
                {/if}
                <div class="item">
                    <p>团队1 (此处为空不开启团队业绩统计)</p>
                    <input type="text" id="tuan1" name="tuan1" placeholder="如:精英队" value="{$tuan1}" />
                </div>
                
                <div class="item" >
                    <p>团队2 (为空不开启此队)</p>
                    <input type="text" id="tuan2" name="tuan2" placeholder="如:超越队" value="{$tuan2}" />
                </div>
                <div class="item">
                    <p>团队3 (为空不开启此队)</p>
                    <input type="text" id="tuan3" name="tuan3" placeholder="如:战狼队" value="{$tuan3}" />
                </div>
                <div class="item">
                    <p>团队4 (为空不开启此队)</p>
                    <input type="text" id="tuan4" name="tuan4" placeholder="如:无敌队" value="{$tuan4}" />
                </div>
                <div class="item">
                    <p>团队5 (为空不开启此队)</p>
                    <input type="text" id="tuan5" name="tuan5" placeholder="如:微商队" value="{$tuan5}" />
                </div>
                <div class="item6" {if $tuanshu<6}style="display:none"{/if}>
                    <p>团队6 (此处为空不开启团队业绩统计)1</p>
                    <input type="text" id="tuan6" name="tuan6" placeholder="如:奇迹队" value="{$tuan6}" />
                </div>
                <div class="item7" {if $tuanshu<7}style="display:none"{/if}>
                    <p>团队7 (为空不开启此队)</p>
                    <input type="text" id="tuan7" name="tuan7" placeholder="如:野狼队" value="{$tuan7}" />
                </div>
                <div class="item8" {if $tuanshu<8}style="display:none"{/if}>
                    <p>团队8 (为空不开启此队)</p>
                    <input type="text" id="tuan8" name="tuan8" placeholder="如:超能队" value="{$tuan8}" />
                </div>
                <div class="item9" {if $tuanshu<9}style="display:none"{/if}>
                    <p>团队9 (为空不开启此队)</p>
                    <input type="text" id="tuan9" name="tuan9" placeholder="如:战神队" value="{$tuan9}" />
                </div>
                <div class="item10" {if $tuanshu<10}style="display:none"{/if}>
                    <p>团队10 (为空不开启此队)</p>
                    <input type="text" id="tuan10" name="tuan10" placeholder="如:微商队" value="{$tuan10}" />
                </div>
                <div class="item11" {if $tuanshu<11}style="display:none"{/if}>
                    <p>团队11 (为空不开启此队)</p>
                    <input type="text" id="tuan11" name="tuan11" placeholder="如:精英队" value="{$tuan11}" />
                </div>
                <div class="item12" {if $tuanshu<12}style="display:none"{/if}>
                    <p>团队12 (为空不开启此队)</p>
                    <input type="text" id="tuan12" name="tuan12" placeholder="如:超越队" value="{$tuan12}" />
                </div>
                <div class="item13" {if $tuanshu<13}style="display:none"{/if}>
                    <p>团队13 (为空不开启此队)</p>
                    <input type="text" id="tuan13" name="tuan13" placeholder="如:战狼队" value="{$tuan13}" />
                </div>
                <div class="item14" {if $tuanshu<14}style="display:none"{/if}>
                    <p>团队14 (为空不开启此队)</p>
                    <input type="text" id="tuan14" name="tuan14" placeholder="如:无敌队" value="{$tuan14}" />
                </div>
                <div class="item15" {if $tuanshu<15}style="display:none"{/if}>
                    <p>团队15 (为空不开启此队)</p>
                    <input type="text" id="tuan15" name="tuan15" placeholder="如:微商队" value="{$tuan15}" />
                </div>
                <div class="item16" {if $tuanshu<16}style="display:none"{/if}>
                    <p>团队16 (此处为空不开启团队1业绩统计)</p>
                    <input type="text" id="tuan16" name="tuan16" placeholder="如:奇迹队" value="{$tuan16}" />
                </div>
                <div class="item17" {if $tuanshu<17}style="display:none"{/if}>
                    <p>团队17 (为空不开启此队)</p>
                    <input type="text" id="tuan17" name="tuan17" placeholder="如:野狼队" value="{$tuan17}" />
                </div>
                <div class="item18" {if $tuanshu<18}style="display:none"{/if}>
                    <p>团队18 (为空不开启此队)</p>
                    <input type="text" id="tuan18" name="tuan18" placeholder="如:超能队" value="{$tuan18}" />
                </div>
                <div class="item19" {if $tuanshu<19}style="display:none"{/if}>
                    <p>团队19 (为空不开启此队)</p>
                    <input type="text" id="tuan19" name="tuan19" placeholder="如:战神队" value="{$tuan19}" />
                </div>
                <div class="item20" {if $tuanshu<20}style="display:none"{/if}>
                    <p>团队20 (为空不开启此队)</p>
                    <input type="text" id="tuan20" name="tuan20" placeholder="如:微商队" value="{$tuan20}" />
                </div>
                <div class="item21" {if $tuanshu<21}style="display:none"{/if}>
                    <p>团队21 (为空不开启此队)</p>
                    <input type="text" id="tuan21" name="tuan21" placeholder="如:精英队" value="{$tuan21}" />
                </div>
                <div class="item22" {if $tuanshu<22}style="display:none"{/if}>
                    <p>团队22 (为空不开启此队)</p>
                    <input type="text" id="tuan22" name="tuan22" placeholder="如:超越队" value="{$tuan22}" />
                </div>
                <div class="item23" {if $tuanshu<23}style="display:none"{/if}>
                    <p>团队23 (为空不开启此队)</p>
                    <input type="text" id="tuan23" name="tuan23" placeholder="如:战狼队" value="{$tuan23}" />
                </div>
                <div class="item24" {if $tuanshu<24}style="display:none"{/if}>
                    <p>团队24 (为空不开启此队)</p>
                    <input type="text" id="tuan24" name="tuan24" placeholder="如:无敌队" value="{$tuan24}" />
                </div>
                <div class="item25" {if $tuanshu<25}style="display:none"{/if}>
                    <p>团队25 (为空不开启此队)</p>
                    <input type="text" id="tuan25" name="tuan25" placeholder="如:微商队" value="{$tuan25}" />
                </div>
                <div class="item26" {if $tuanshu<26}style="display:none"{/if}>
                    <p>团队26 (此处为空不开启团队2业绩统计)</p>
                    <input type="text" id="tuan26" name="tuan26" placeholder="如:奇迹队" value="{$tuan26}" />
                </div>
                <div class="item27" {if $tuanshu<27}style="display:none"{/if}>
                    <p>团队27 (为空不开启此队)</p>
                    <input type="text" id="tuan27" name="tuan27" placeholder="如:野狼队" value="{$tuan27}" />
                </div>
                <div class="item28" {if $tuanshu<28}style="display:none"{/if}>
                    <p>团队28 (为空不开启此队)</p>
                    <input type="text" id="tuan28" name="tuan28" placeholder="如:超能队" value="{$tuan28}" />
                </div>
                <div class="item29" {if $tuanshu<29}style="display:none"{/if}>
                    <p>团队29 (为空不开启此队)</p>
                    <input type="text" id="tuan29" name="tuan29" placeholder="如:战神队" value="{$tuan29}" />
                </div>
                <div class="item30" {if $tuanshu<30}style="display:none"{/if}>
                    <p>团队30 (为空不开启此队)</p>
                    <input type="text" id="tuan30" name="tuan30" placeholder="如:微商队" value="{$tuan30}" />
                </div>
                <div class="btnadd">
                    <p style="text-align: right; font-size: 0.3rem; "><a href="javascript:showitem()">点击增加5个团队</a>
</p></div>
                <!-- <p>超过5个团队,可在电脑后台->活动编辑->手机管理，或手机->手机管理，进行修改,最多支持30个团队</p> -->

                <div style="text-align: center;">
                    <input type="hidden" name="level" value="{$level}">
                    <input type="hidden" name="company" value="{$company}">
                    <input type="hidden" name="jiami" value="jiami">
                    <button class="l_btn" type="submit" >下一步(可略过)</button>
                </div>
                <div style="height: 30px"></div>
                <script type="text/javascript">
                    var tuanshu = {$tuanshu};
                    function showitem() {
                        tuanshu = tuanshu +1;
                        $(".item"+tuanshu).show();
                        tuanshu = tuanshu +1;
                        $(".item"+tuanshu).show();
                        tuanshu = tuanshu +1;
                        $(".item"+tuanshu).show();
                        tuanshu = tuanshu +1;
                        $(".item"+tuanshu).show();
                        tuanshu = tuanshu +1;
                        $(".item"+tuanshu).show();
                        if (tuanshu>=29) {
                        $(".btnadd").hide();}
                    }
                </script>
            </div>
        </form>
        {/if} 
    {else}
        <form action='{php echo "/".createMobileUrl($do,array("op"=>"next","themeid"=>$themeid,"server_openid"=>$_P['server_openid']));}' method="post" onsubmit="return check1()">  
            <div class="lmsz_cont">
                {if $system['ruanjian']==3}
                <div class="item">
                    <p><span style="color: #ff0000">*</span>请选择所属企业</p>
                    <select id="company" name="company" class="sdiv">
                    <option value="">请选择所属企业</option>
                    {loop $shoplist $row}name
                    <option value="{$row['id']}" {if $row['id'] == $myworker['company']}selected="selected"{/if}>{$row['name']}</option>
                    {/loop}
                </select>
                </div>
                {/if}
                <div class="item">
                    <p><span style="color: #ff0000">*</span>输入您的操作密码</p>
                    <input type="number" id="pass" name="pass" placeholder="请注意管理员与员工密码不相同"  value=""/>
                </div>

                <div style="text-align: center;">
                    <input type="hidden" name="jiami" value="jiami">
                    <button class="l_btn" type="submit" >下一步</button>
                </div>
                <div style="height: 30px"></div>
            </div>
        </form>
    {/if}
        {include file='yxworker/w_foot_yixuan'}
        <script type="text/javascript">
            function check1() {
                {if $system['ruanjian']==3}
                    var company = $('#company option:selected').val();
                    if(company.length <=0){
                        alert('请选择所属企业');
                        return false;
                    }
                {/if}
                 var pass = $('#pass').val();
                 if(pass == ''){
                    alert('请输入您的操作密码');
                    return false;
                 }
            }
            function check2() {
                {if !empty($teamlist)}
                    var team = $('#team option:selected').val();
                    if(team.length <=0){
                        alert('请选择所属团队');
                        return false;
                    }
                {/if}
                 var username = $('#username').val();
                 if(username == ''){
                    alert('请输入您的昵称');
                    return false;
                 }
                 var mobile = $('#mobile').val();
                 if(mobile.length == 0){
                    alert('请输入您的电话');
                    return false;
                 }
                 if(mobile.length != 11 && mobile.length != 7 && mobile.length != 8){
                    alert('请输入您的正确的手机号，座机请不要输入区号');
                    return false;
                 }
            }

        </script>
<script>
        function onBridgeReady() {
            WeixinJSBridge.call('hideOptionMenu');
        }

        if (typeof WeixinJSBridge == "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        } else {
            onBridgeReady();
        }
    </script>
    </body>
</html>

<script type="text/javascript" src="{$_G['URL']['WORKER_CSS']}js/js.js"></script>

